package com.yboot.module.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yboot.module.system.model.dto.SysClientDto;
import com.yboot.module.system.model.vo.SysClientVo;
import com.yboot.module.system.model.vo.SysClientDetailVo;
import com.yboot.module.system.model.query.SysClientQuery;
import com.yboot.module.system.model.entity.SysClientEntity;
import com.yboot.module.system.service.ISysClientService;
import com.yboot.module.system.mapper.SysClientMapper;
import com.yboot.starter.mybatis.core.base.service.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;

/**
 * 客户端表
 * @author yangcs
 * @date 2025-08-29
 */
@Service
public class SysClientServiceImpl extends BaseServiceImpl<SysClientMapper, SysClientEntity, SysClientVo, SysClientDetailVo, SysClientQuery, SysClientDto> implements ISysClientService {


    @Override
    public SysClientEntity getByClientId(String clientId) {
        LambdaQueryWrapper<SysClientEntity> queryWrapper = Wrappers.<SysClientEntity>lambdaQuery()
                .eq(SysClientEntity::getClientId, clientId)
                .last("limit 1");
        return getOne(queryWrapper);
    }
}
